home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12574 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.8 KB

  1. Path: hermes.is.co.za!news
  2. From: Itsik Rubin <yr@isis.co.za>
  3. Newsgroups: comp.lang.c++
  4. Subject: Correctnes of BORLAND C++ RTTI Info in a multi threaded environment (WindowsNT)
  5. Date: Wed, 20 Mar 1996 18:23:25 +0200
  6. Organization: No organisation supplied
  7. Message-ID: <315030FD.5898@isis.co.za>
  8. NNTP-Posting-Host: yr.isis.co.za
  9. Mime-Version: 1.0
  10. Content-Type: multipart/mixed; boundary="------------1055B205B2"
  11. X-Mailer: Mozilla 2.0GoldB1 (WinNT; I)
  12.  
  13. This is a multi-part message in MIME format.
  14.  
  15. --------------1055B205B2
  16. Content-Type: text/plain; charset=us-ascii
  17. Content-Transfer-Encoding: 7bit
  18.  
  19. Please see the attached file.
  20.  
  21. Regrads
  22. Itsik
  23. yr@isis.co.za
  24.  
  25. --------------1055B205B2
  26. Content-Type: text/plain; charset=us-ascii
  27. Content-Transfer-Encoding: 7bit
  28. Content-Disposition: inline; filename="mail.htm"
  29.  
  30. Hello, I am using Borland C++ Version 4.51 under Windows NT I am developping
  31. a 32 bit application that is intended for Windows NT and I use extensively
  32. multi threading as wellas the streaming mechanism provided in the Borland
  33. class library. This is used for inter thread , inter process and inter
  34. processor (over a LAN) communication. The developped system is required to
  35. run continuously 24 hours a day 7 days a week. Approximatly once a day I run
  36. into a problem where during the operation of the system a stream becomes
  37. corrupted. When I make the following change to the opstream::WriteData
  38. method inside objstrm.cpp I get logs in both places (marked 1 and 2). Based
  39. on my observation the first _TYPENAME(strmr) is erronous whereas the second
  40. one returns correct results. This points to problems within the RTTI
  41. mechanism. The following questions (at least) need answer: 1. Is typeinfo
  42. object, which is part of the Borland C++ RTTI, multi-thread safe? 2. Has
  43. anyone else encounted this problem? 3. Is there a fix for this problem? The
  44. modified method in objstrm.cpp: void opstream::writeData( const
  45. TStreamableBase *t, ModuleId mid ) { if( good() ) { registerObject(
  46. CONST_CAST(TStreamableBase *,t) ); const ObjectBuilder *res = types->Lookup(
  47. mid, _TYPENAME(t) ); CHECKX(res,_TYPENAME(t)); TStreamer *strmr =
  48. res->Builder(CONST_CAST(TStreamableBase *,t)); /**/ if ( t ) /**/ { /**/
  49. char check [100] ; /**/ char strmtname [100] ; /**/ strcpy ( strmtname,
  50. _TYPENAME(strmr) ); /**/ sprintf ( check , "%s::Streamer" , _TYPENAME(t) ) ;
  51. /**/ if ( strcmp ( check , strmtname ) != 0 ) /**/ { /**/ char temp [200] ;
  52. /**/ sprintf ( temp , "WriteData lookup error %s not equal to %s" , check ,
  53. strmtname ) ; /* (1) */ cout << temp << endl; /**/ if ( strcmp ( strmtname,
  54. _TYPENAME(strmr) ) != 0 ) /**/ { /**/ sprintf ( temp, "WriteData changed
  55. typeinfo %s to %s", strmtname, _TYPENAME(strmr) ) ; /* (2) */ cout << temp
  56. << endl; /**/ } /**/ } /**/ } writeWord32( strmr->ClassVersion() );
  57. strmr->Write( *this ); delete strmr; } } Your quick response will be greatly
  58. appreciated. Regards,
  59.  
  60. --------------1055B205B2--
  61.  
  62.